﻿using System;
using System.Collections.Generic;
using System.IO;
using System.Linq;
using System.Net;
using System.Net.Http;
using System.Text;
using System.Web.Http;
using LWinfrastructure;
using EPocalipse.IFilter;

namespace IFilterData64.Controllers
{
    public class ValuesController : ApiController
    {
        // GET api/values?filePath=xxxxxxxxxxxxxx
        public FileText Get(string filePath)
        {
            FileText fText = new FileText();
            fText.FileName = filePath;

            TextReader reader = new FilterReader(filePath);
            using (reader) {
                fText.TextData = reader.ReadToEnd();
            }

            return fText;
        }

    }
}